<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
		<link rel="stylesheet" type="text/css" href="../css/aui.css"/>
		<link rel="stylesheet" type="text/css" href="../icon/aosen/css/font-awesome.min.css" />
    <style>
    	body,html{
				background:#EEEEEE
    	}
      .header{
        width: 3rem;
        height:3rem;
        border-radius: 50%;
        overflow: hidden;

      }
      .heaer img{
        width: 100%;
        height: 100%;
        display: block;
      }
    </style>
</head>
<body>
  <div class="aui-content" style="margin-bottom:2.5rem">
      <ul class="aui-list aui-list-in">
          <li class="aui-list-item"  style="height:3rem;">
              <div class="aui-list-item-inner ">
                  <div class="aui-list-item-title">开户行</div>
                  <input type="text" class="aui-pull-right" id="bankName" placeholder="输入开户行" style="width:60%;text-align:right">
              </div>
          </li>
          <li class="aui-list-item" style="height:3rem;">
              <div class="aui-list-item-inner ">
                  <div class="aui-list-item-title">卡号</div>
                  <input type="text" class="aui-pull-right" id="bankNum" placeholder="输入银行卡号" style="width:80%;text-align:right">
              </div>

          </li>
					<li class="aui-list-item" style="height:3rem;">
              <div class="aui-list-item-inner ">
                  <div class="aui-list-item-title">银行卡真实姓名</div>
                  <input type="text" class="aui-pull-right" id="bankRealName" placeholder="输入银行卡真实姓名" style="width:50%;text-align:right">
              </div>

          </li>
      </ul>
  </div>
  <div style="position: fixed;bottom: 0;left: 0;width: 100%;height: 2.5rem;text-align: center;line-height: 2.5rem;background: #e14104;color: white;font-size: 5.5vw;" onclick="submit()">提交</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/request.js"></script>
<script type="text/javascript">

  var userInfo;
	apiready = function(){
    userInfo = api.pageParam.data;

    $api.val($api.byId('bankName'), userInfo.bank_name);
    $api.val($api.byId('bankNum'), userInfo.bank_num);
		$api.val($api.byId('bankRealName'), userInfo.bank_realname);
	};
  function submit(){
    var data = {};
    data['values'] = {};
    data['values']['bankName'] = $api.val($api.byId('bankName'));
    data['values']['bankNum'] = $api.val($api.byId('bankNum'));
		data['values']['bankRealName'] = $api.val($api.byId('bankRealName'));
    data['values']['userId'] = $api.getStorage('userId');
    requestData('Users/userEdit',data,'NO','NO','NO',_callbackRelt);
  }
  function _callbackRelt(ret){
    if(ret.status == 200){
      api.toast({
	            msg: ret.msg,
	            duration: 1000,
	            location: 'bottom'
	        });
          api.sendEvent({
              name: 'editDone',

          });

          setTimeout(function(){
            api.closeWin();

          },1000);
    }else{
      api.toast({
	            msg: ret.msg,
	            duration: 1000,
	            location: 'bottom'
	        });
    }
  }
  function setBank(){
  	api.openWin({
        name: 'setBank',
        url: './win.html',
        pageParam: {
            page:'setBank',
            title: '银行卡',
            data:userInfo
        }
    });
  }
</script>
</html>
